package com.gc.server.vo.down;


import lombok.Data;

import java.util.Date;

import com.alibaba.excel.annotation.*;

import java.io.Serializable;


import com.gc.server.entity.UserShopEntity;
import com.gc.server.vo.UserShopVo;


/**
 * 用户店铺管理关系集合实体
 * 表名 user_shop
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date ${datetime}
 */
@Data
public class UserShopDown implements Serializable {
    @ExcelIgnore
    private static final long serialVersionUID = 1L;

    //
    @ExcelProperty("")
    private Long id;

    //用户ID
    @ExcelProperty("用户ID")
    private Long userId;

    //用户ID
    @ExcelProperty("用户名")
    private String name;


    //用户ID
    @ExcelProperty("用户编号")
    private String code;

    @ExcelProperty("店铺名")
    private String shopName;

    //店铺编号
    @ExcelProperty("店铺编号")
    private String shopCode;

    //店铺ID
    @ExcelProperty("店铺ID")
    private Long shopId;

    //备注
    @ExcelProperty("备注")
    private String remark;


    public UserShopDown() {

    }

    public UserShopDown(UserShopVo vo) {
        UserShopEntity entity = vo.getEntity();
        this.setId(entity.getId());
        if(vo.getUser()!=null){
            this.setCode(vo.getUser().getCode());
            this.setName(vo.getUser().getName());
        }
      if(vo.getShop()!=null){
          this.setShopCode(vo.getShop().getCode());
          this.setShopName(vo.getShop().getShopName());
      }

        this.setUserId(entity.getUserId());
        this.setShopId(entity.getShopId());
        this.setRemark(entity.getRemark());
    }


}
